package com.wuyoucar.controller;

import com.wuyoucar.common.ResultBean;
import com.wuyoucar.service.PersionCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer")
public class TUserController {

    @Autowired
    private PersionCenterService persionCenterService;

    //展示用户的个人信息
    @GetMapping("/showinfo/{userid}")
    public ResultBean queryOneById(@PathVariable("userid") Integer userid){
        return persionCenterService.queryOneById(userid);
    }

    //发送验证码
    @GetMapping("/getvcode/{newphone}")
    public ResultBean getVcode(@PathVariable("newphone")String newphone){
        return persionCenterService.getVcode(newphone);
    }

    @GetMapping("/updatepwd/{newpwd0}/{newpwd1}/{userid}")
    public ResultBean updatePwd(@PathVariable("newpwd0")String newpwd0,
                                @PathVariable("newpwd1")String newpwd1,
                                @PathVariable("userid")Integer userid
    ){
        return persionCenterService.updatePwd(newpwd0,newpwd1,userid);
    }


    //查询理赔单
    @GetMapping("/mycliam/{userid}")
    public ResultBean selectreport(@PathVariable("userid")Integer userid){
        return persionCenterService.selectreport(userid);
    }
}
